#pragma once

#include <QMainWindow>

class FramelessMainWindow : public QMainWindow
{
    Q_OBJECT

public:
    FramelessMainWindow(QWidget *parent = Q_NULLPTR);
    ~FramelessMainWindow();

public:
    void        setHeaderWidget(QWidget* header);
    void        setBorderWidth(int iBorderWidth);

protected:
    bool        nativeEvent(const QByteArray &eventType, void *message, long *result) override;
    bool        eventFilter(QObject* obj, QEvent* e);

public:
    int         _borderWidth = 5;
    QWidget*    _headerWidget = Q_NULLPTR;

    QPoint      _oldHitPos;
};
